package com.example.s14_jpa2.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserParam
{
    private long id;
    @NotEmpty(message="姓名不能为空")
    private String username;
    @NotEmpty(message="密码不能为空")
    @Length(min=1,message="密码长度不能小于6位")
    private String password;
    @Max(value = 100, message = "年龄不能大于100岁")
    @Min(value= 1 ,message= "必须年满18岁！" )
    private int age;
}